/**
 * Created by 小敏哥 on 2017/6/23.
 */
import React, {Component} from 'react'
import style from './documentList.scss';

export default class DocumentList extends Component {

    //构建所需资料列表
    structRequirementList(){
        return this.filterEmpty(this.props.requirements).map((requireItem,index)=>{
            return  <li key={"requireItem"+index}><span>{index+1}</span><span>{requireItem.requirement}</span></li>
        });
    }

    //剔除空的项
    filterEmpty(requirements){
        let result=[];
        for(let item of requirements){
            if(item.requirement){
                result.push(item);
            }
        }
        return result;
    }

    render(){
        return <ul className={style.process}>
            {this.structRequirementList()}
        </ul>
    }
}